from appium import webdriver 
from time import sleep

desired_capabilities = {
  "platformName": "Android",
  "platformVersion": "5.1.1",
  "deviceName": "62001"
}

driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',desired_capabilities=desired_capabilities)

# 点击 美图秀秀 content-desc
driver.find_element_by_accessibility_id('美图秀秀').click()

# 点击 同意并继续
# driver.find_element_by_xpath('//*[contains(@text,"同意并继续")]').click()
# driver.find_element_by_xpath('//*[@resource-id="com.mt.mtxx.mtxx:id/btn_positive"]').click()

# uiautomator定位
# driver.find_element_by_android_uiautomator('new UiSelector().text("同意并继续")').click()

# resource-id  resouceId
driver.find_element_by_android_uiautomator('new UiSelector().resourceId("com.mt.mtxx.mtxx:id/btn_positive")').click()